package com.xiaoshuidi.cloud.module.report.service.finance;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.report.controller.finance.vo.DetailIncomePageReqVO;
import com.xiaoshuidi.cloud.module.report.controller.finance.vo.DetailIncomePageRespVO;
import com.xiaoshuidi.cloud.module.report.controller.finance.vo.ExportRespVO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.IncomeDetailReportDO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.IncomeSummaryReportDO;

import java.math.BigDecimal;
import java.util.List;

public interface IncomeDetailReportService {

    /**
     * 收入汇总明细 列表查询
     */
    PageResult<DetailIncomePageRespVO> detailIncomePage(DetailIncomePageReqVO reqVO);

    /**
     * 查询合同最近一笔的累计收入
     */
    IncomeDetailReportDO getRecentIncomeReport(Long contractId,String currentMonth);

    /**
     * 收入汇总表导出
     */
    ExportRespVO detailIncomeExport(DetailIncomePageReqVO req);

    void insertBatch(List<IncomeDetailReportDO> list);

    void updateBatch(List<IncomeDetailReportDO> list);


    long countDetailsInCurrentMonth(String currentMonth);

    List<IncomeDetailReportDO> selectDetailsInCurrentMonth(String currentMonth);

    List<IncomeDetailReportDO> selectDetailsInCurrentMonthInTurn(String currentMonth,Integer from,Integer pageSize);

    IncomeDetailReportDO selectDetailsByContractIdInCurrentMonth(Long contractId, String currentMonth);

    BigDecimal sumTotalRentAndWaterByContractId(Long contractId);

    List<IncomeDetailReportDO> selectDetailsInCurrentMonthAndContractIds(String currentMonth,List<Long> contractIds);

    List<IncomeSummaryReportDO> selectDetailsInCurrentMonthGroupByApartmentId(String currentMonth);
}
